package com.object.module.lq.sys.controller;


import cn.dev33.satoken.stp.StpUtil;
import com.object.module.lq.sys.entity.TUserEntity;
import com.object.module.lq.sys.service.TUserService;
import com.object.utils.Q;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * @作者：小庆  <p>🌤</p>
 * @date: 2022/6/3
 * @email:1578442339@qq.com
 **/
@RestController
@RequestMapping("/test")
public class TSysTestController
{

    @Resource
    private TUserService userService;

    @GetMapping()
    public Q getAll(String token)
    {
        return Q.ok().put("data", StpUtil.getLoginIdByToken(token));
    }

    @GetMapping("index")
    public Q FilterFields()
    {
        List<TUserEntity> list = userService.list();
        return Q.ok().filterFields(TUserEntity.class, list, "urUsername", "urPassword");
    }
}
